package com.evil.kingdom.pojo.dto.core;

import com.evil.kingdom.pojo.entity.base.Fight;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;

import java.util.Objects;

/**
 * 坐骑
 *
 * @author liyang
 * @date 2024-05-17 16:01
 */
@Getter
@Setter
public class MountDto extends Fight {

    /**
     * 名称
     */
    @NotBlank(message = "名称不能为空")
    private String name;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MountDto mountDto = (MountDto) o;

        return Objects.equals(name, mountDto.name);
    }

    @Override
    public int hashCode() {
        return name != null ? name.hashCode() : 0;
    }
}
